home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_sq15.zip
/
PCB.SLT
< prev
next >
Wrap
Text File
|
1991-01-09
|
18KB
|
506 lines
//-----------------------------------------------------------
// PCB.SL? Telix script for logon to a PCBoard BBS.
//
// This script is normally called from the script LOGON.SLC.
//
// Please look at the comments through the whole file, and modify to
// suit your needs, BEFORE you use it. Then recompile with CS PCB.
//-----------------------------------------------------------
// Author: Inge Vabekk
// Hamangskogen 108
// N-1300 SANDVIKA
// NORWAY
str thisBBStype[]="PCB" // Must be PCB to work.
,line [80] // Temporary line.
,logfile [64] // Log file name.
,catfile [32] // Catalog file name.
,filelist [12] // Name of file list.
,Sdoor [2] // and door to open
,myprot [2] // My protocol
,hisprot [2] // and BBS's prot. character.
,command [10] // Current command prompt.
// For the Global storage:
,global []="GLOBAL" // Global script.
,bbstype []="BTYPE" // BBS type.
,short []="SHORT" // Short BBS name.
,Cprot []="CPROT" // Current protocol.
,Hprot []="HPROT" // "His" protocol.
,passw []="PASSW" // Current password.
,version []="PCBVER" // Current PCB version.
,prompt []="PROMPT" // Current command prompt.
,conf []="CONF" // Current conference.
,filist []="FILIST" // Name of BBS file list.
,mscript []="MDOOR" // Name of mail door/script.
;
int tol = 300 // No activity for 30 sec.
,tmark // makes script time out.
,stat
,door // Door number.
,InDoor // TRUE if in door.
,mega // MegaMail door.
,MarkM // MarkMail door.
,dbdoor // Dial-Back door.
,PCBver // PCB version
,first
,cm // Trig on Command prompt
,pm // Trig on "Personal Mail"
,pw // Password trigger, carried over
; // from the LOGON script.
//-----------------------------------------------------------
// PCBOARD logon script entered here.
// Note: The "pw" parameter contains trig number for an
// additional password request from PCBoard (in case the
// first attempt failed).
//-----------------------------------------------------------
main (int pw1)
{
int i, m
,error
;
pw = pw1; // Move parameter to global.
pm = track ("nter)=yes?",0); // Start tracking this at once.
first = 1; // First time on.
entry(); // Update colors & status bar.
// Only if online.
if (!carrier())
{ failtone();
status_wind ("THIS SCRIPT ONLY WORKS IF YOU'RE ONLINE!",20);
return (-1);
}
read (bbstype,line); // Get BBS type.
if (line != thisBBStype)
{ wrongBBS(); // Doesn't match script!
return (-1);
}
read (filist,filelist); // Get name of file list.
read (version,line);
PCBver = stoi (line); // Get PCB version.
write (conf,"Main Board"); // Always starts in this conf.
command = "Command"; // Set code for command prompt.
write (prompt,command); // Start tracking NOW.
cm = track (command, 0); // Command.
read (Cprot,myprot);
if (myprot=="1")
hisprot = "O";
else if (myprot=="Y")
hisprot = "YG";
else if (myprot=="D")
hisprot = "Z";
else
hisprot = myprot;
write (Hprot,hisprot); // Write BBS protocol.
InDoor = PCBver < 100; // Entry from ProLgon:
if (PCBver > 144) // For PCBoard < 14.5 we should
{ door = 0; // be in door already.
InDoor = 1;
i = strposi(_entry_name,"D:",0); // Find door number from name.
if (i > 0)
{ substr (_entry_name,i+2,2,Sdoor); // Copy max. 2 characters.
door = stoi(Sdoor); // Find door number.
if (door != 0) InDoor = 0;
}
}
else // ProLogon or PBCoard < 14.5:
{ Sdoor = "1"; // Door 1 is default.
door = 1;
}
// Start tracking incoming text. For ease of reading and programming,
// and to improve speed, this is split into different sections.
//-----------------------------------------------------------
error = SECTION1(); // Run section one.
release();
fail:
if (error)
{ failtone();
status_wind ("Logon failed!",20);
return (-1);
}
itos (PCBver,line); // Update PCB version.
write (version,line);
line="MAILUP"; // ASCII upload mail.
if (MarkM) // Check which door.
line="MARKMAIL"; // Chain to the MarkMail script.
else if (mega)
line="MEGAMAIL"; // Chain to the MegaMail script.
else if (dbdoor)
{ error = call ("DialBack"); // Chain to the DialBack script.
if (error) goto fail; // Can't continue.
}
write (mscript,line); // Write name of mail script.
if (first) first = GetPrompt();
entry();
call ("JoinConf","Main Board"); // Back to Main Board.
newfiles(); // Go get new files.
return (0);
}
//-----------------------------------------------------------
// Section 1: Check any happenings before first command.
//-----------------------------------------------------------
SECTION1()
{
int c // Single character.
,lfs
,error
,novice // For tracking:
,more // "More" prompt received if TRUE.
,he // Help needed
,en // ENTER to continue
,ns // Non-stop request.
,mo1 // More?
,mo2
,lf // Linefeed.
,dr1, dr2, dr3, dr4 // various doors.
;
mega=MarkM=dbdoor=more=novice = 0; // Preset some.
dr2 = dr3 = dr4 = 0;
dr1 = track ("ProDoor ",0); // ZIPM mail.
if (door > 1)
{ dr2 = track ("M a r k M",0); // MarkMail.
dr3 = track ("ing MEGA,",0); // Megamail.
dr4 = track ("DB_DOOR ",0); // Dial-Back door.
}
mo1 = track ("p, More?",0); // More?
mo2 = track ("continue",0); // More?
he = track (" for help",0); // Novice.
en = track ("to conti",0); // Enter to continue
ns = track ("non-stop",0); // Non-stop request?
lf = track ("^J",0); // Long list? (trig on LF)
tmark = timer_start (100); // Give me 10 sec.
while ((stat=trig()) > 0) // answer any logon questions
{ if (stat == lf) // Linefeed?
{ if (++lfs%5 == 0) // More than 5: Send break.
cputs ("^K");
continue;
}
else
lfs = 0; // Other trig: Reset lf count.
if (stat==dr1 && !InDoor // ProDoor? No mail?
&& door != 1)
PCBver = 140; // Say version is old (14.0)
// because we're in ProDoor.
else if (stat==dr1 || stat==dr2 // ProDoor? MarkMail?
|| stat==dr3 || stat==dr4) // MegaMail? Dial-Back?
{ InDoor = 1;
track_free(dr1); // Free all tracks and timer.
if (dr2) track_free(dr2);
if (dr3) track_free(dr3);
if (dr4) track_free(dr4);
if (stat == dr1)
PCBver = 140;